package com.sskj.jgxt.impl;

import javax.transaction.Transactional;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.sskj.core.annotation.ControllerLogExeTime;
import com.sskj.jgxt.jd.entity.JianDuJiLu;
import com.sskj.jgxt.param.RiZhiQueryParam;
import com.sskj.jgxt.repository.RiZhiJLRepository;
import com.sskj.personnel.repository.EmployeeRepository;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import springfox.documentation.annotations.ApiIgnore;

@RestController
@RequestMapping(value = "/wechat/rzjl", method = { RequestMethod.POST, RequestMethod.GET })
@Transactional
@Api(value = "日志记录", description = "日志记录")
public class WeChartRZJDJLServiceImpl {

	protected final Log logger = LogFactory.getLog(WeChartRZJDJLServiceImpl.class);

	@Autowired
	RiZhiJLRepository repository;

	@Autowired
	EmployeeRepository employeeRepository;

	@Value("${sskj.conf.restUrl}")
	private String restUrl;


	@CrossOrigin(origins = "*", maxAge = 3600)
	@RequestMapping(value = "/page")
	@ControllerLogExeTime(description = "查询日志记录", log = false)
	@ApiOperation(value = "日志记录", httpMethod = "GET")
	@ApiImplicitParams({ @ApiImplicitParam(name = "keyword", value = "记录编号", paramType = "form", dataType = "string"),			
			@ApiImplicitParam(name = "userid", value = "用户", paramType = "form", dataType = "string"),
			@ApiImplicitParam(name = "isUpload", value = "是否上传", paramType = "form", dataType = "string"),
			@ApiImplicitParam(name = "pageNumber", value = "页号", paramType = "form", dataType = "int"),
			@ApiImplicitParam(name = "pageSize", value = "页的大小", paramType = "form", dataType = "int") })
	public Page<JianDuJiLu> queryPage(@ApiIgnore RiZhiQueryParam queryParam,
			@ApiIgnore Pageable pageable) {

		Page<JianDuJiLu> page = repository.findRZJLPage(queryParam, pageable);
		return page;
	}


}
